var app = new Vue({
	el:"#app", //告诉vue,它应该和哪一个原生绑定,作用在id等于app的元素上
	data: { //data里面的所有属性都是直接绑定在app里面的
		from:2, //null, 默认为空,1默认为王家沟, 2默认为背背山,很轻松的做默认值
		dest:[1], //多选, 默认王家沟
		article:"我是一片文章,哈哈哈哈哈哈哈哈!",
		role:"super_admin",
		name:null,
		age:null,
		sex:null,
		math:90,
		physics:86,
		english:301,
		sex1:"female",//单选默认女
		sex2:["female"], //多选
		foodList:['葱','姜','蒜'],
		food:[
		 {
			 name:'葱',
			 price:10,
			 discount:0.9,
		 },
		 {
			 name:'姜',
			 price:15,
			 discount:0.8,
		 },
		 {
			 name:'蒜',
			 price:20,
		 }
		],
		url:'http://baidu.com',
		img:"https://picture.yuyankeji.cn/5ecfbb93e55071590672275.png",
		klass: 'btn btn-default',
		isActive:true,
	},
	computed:{ //计算属性
		sum: function(){
			return parseFloat(this.math) + parseFloat(this.physics) + parseFloat(this.english);
		},
		average: function(){
			return Math.round(this.sum / 3);
		}
	},
	methods:{
		onClick:function(){
			console.log("已经点击了");
		},
		onEnter:function(){
			console.log("onEnter");
		},
		onOut:function(){
			console.log("onOut");
		},
		onSubmit:function(){
			console.log("onSubmit");
		},
		onEnter:function(){
			console.log("onEnter");
		}

	}
});